package org.github.rayson517.easyplatform.message.init;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.corundumstudio.socketio.SocketIOServer;

/**
 * 启动socketIOServer
 * @author rayson517
 *
 */
@Component
@Order(value=1)
public class SocketIOServerCommandLineRunner implements CommandLineRunner {
	private static final Logger log = LoggerFactory.getLogger(SocketIOServerCommandLineRunner.class);
	private SocketIOServer socketIOServer;
	
	@Autowired
    public SocketIOServerCommandLineRunner(SocketIOServer socketIOServer) {
        this.socketIOServer = socketIOServer;
    }

	
	@Override
	public void run(String... args) throws Exception {
		// TODO Auto-generated method stub
		socketIOServer.start();
		log.info(">>>>>>>> socketIOServer 启动成功!");
	}

}
